
Algorithm::Algorithm( const char* in_file ){
	srand(time(NULL));
	
	this->input_file = in_file;
	ifstream in( in_file, ifstream::in );
	
	in >> k >> L;
	
	sets = new Set[L];
	
	for( int i = 0; i < L; ++i ){
		int cardinality;
		in >> cardinality;
		for( int j = 0; j < cardinality; ++j ){
			int element;
			in >> element;
			sets[i].insert( element );
		}
	}
	in.close();
}

Algorithm::~Algorithm(){
	delete [] sets;
}

bool Algorithm::isValidSolution(int* s){
	for (int i = 0; i < k; ++i ) 
		for (int j = i+1; j < k; ++j ) 
			if (s[i] == s[j])
				return false;
	return true;
}